#!/bin/sh
do_tests() {
  testrun=$1
  shift
  IFS=" "
  for test_file in $TESTFILES ; do
      __testrun=$(echo "$testrun" | sed "s|%f|$test_file|")
      eval $__testrun > $test_file.fine
      saved_return_status=$?
      if [ $saved_return_status -ge 1 ] ; then 
	error error:return_status "'${__testrun%\ *}' returned $saved_return_status  on $testfile, saving result to $test_file.fail" 
	mv $test_file.fine $test_file.fail
      elif [ ! $SHMK_TESTS_SAVEFINE ] ; then # set to true do remove fine files
	rm $test_file.fine
      fi
  done
}
